package com.cloudsea.yunhaistores.vo;

import com.cloudsea.yunhaistores.entity.Skus;
import com.cloudsea.yunhaistores.entity.Spus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Schema(description = "完整的购物车视图对象")
public class ShoppingCartVO {
    private List<CartItemVO> items;
    private int totalQuantity;
    private long totalAmount;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "购物车中的单个商品项")
    public static class CartItemVO {
        @Schema(description = "商品SPU信息")
        private Spus spu;
        @Schema(description = "商品SKU信息")
        private Skus sku;
        @Schema(description = "购买数量")
        private int quantity;
    }
}
